//
//  CourseIntroductionVC.m
//  Courses
//
//  Created by YiXuePxh on 15/4/21.
//  Copyright (c) 2015年 boyibang. All rights reserved.
//

#import "CourseIntroductionVC.h"
#import "WTFRect.h"

static const CGFloat kHeaderHeight = 10;
static const CGFloat kSegmentHeight = 0;
static const CGFloat kSegmentMargin = 10;


@interface CourseIntroductionVC ()

@end

@implementation CourseIntroductionVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"课程介绍";
    NSLog(@"myCourse:%@",_course.courseName);
    // Do any additional setup after loading the view.
    UIView *backgroundView = [[UIView alloc] initWithFrame:[self sharedFrame]];
    backgroundView.backgroundColor = [UIColor clearColor];
    CGFloat paddingX = 20, paddingY = 15;
    UILabel* showLabel = [[UILabel alloc] initWithFrame:AutoRectMake(paddingX, paddingY, backgroundView.width - paddingX * 2, backgroundView.height - paddingY * 2, WTFAutoLayoutTypePic)];
    if (_course.courseDescription.length > 0) {
        showLabel.text = _course.courseDescription;
    }else{
        showLabel.text = @"暂无课程介绍！";
    }
    showLabel.frame = [showLabel textRectForBounds:showLabel.frame limitedToNumberOfLines:0];
    [backgroundView addSubview:showLabel];
    
    [self.view addSubview:backgroundView];
    
}

- (CGRect)sharedFrame
{
    CGFloat y = RevFloat(kHeaderHeight + kSegmentHeight + kSegmentMargin - 10);
    return AutoRectMake(0, y, DEFAULT_WIDTH, DEFAULT_TABLE_VIEW_HEIGHT + DEFAULT_TABBAR_HEIGHT - y, WTFAutoLayoutTypePic);
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
